<?php

namespace Shared\Extensions\Twig;

/**
 * Description of Path
 *
 * @author nofear
 */
class Asset extends \Twig_Extension {

    public function getFunctions() {
        return array(
            'asset' => new \Twig_Function_Method($this, 'createAssetPath'),
        );
    }

    public function createAssetPath($name) {
        return \Shared\Application::getInstance()->getDir() . '/resources/' . $name;
    }

    public function getName() {
        return 'asset';
    }

}
